package cn.mw.cmdb.entity.cloudWisdom;

import cn.mw.cmdb.entity.PropertyTypeString;
import cn.mw.cmdb.entity.PropertyTypeSwitch;
import cn.mw.components.mongodb.anno.AutoId;
import cn.mw.components.mongodb.anno.CMDBProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Map;

@Data
@Document("mw_cmdbmd_cloud_wisdom_instance_report_history_info")
@Schema(description = "云智慧上报历史")
public class CloudWisdomInstanceReportHistoryInfo {
    @CMDBProperty(searchType = PropertyTypeString.ID, searchPrefix = "_")
    @AutoId
    @Schema(description = "id")
    private String id;

    @Schema(description = "上报规则")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String ruleId;

    @Schema(description = "上报任务ID")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String historyId;

    @Schema(description = "实例ID")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String instanceId;

    @Schema(description = "资产名称")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String instanceName;

    @Schema(description = "模型名称")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String modelName;

    @Schema(description = "模型分组")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String modelGroupName;

    @Schema(description = "上报时间")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String reportDate;

    @Schema(description = "上报人")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String reportBy;

    @Schema(description = "上报类型")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String operateType;

    @Schema(description = "上报结果")
    @CMDBProperty(searchType = PropertyTypeSwitch.ID)
    private Boolean reportResult;

    @Schema(description = "上报参数")
    @CMDBProperty
    private Map<String,Object> requestParam;

    @Schema(description = "追踪ID")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String requestId;

    @Schema(description = "失败原因")
    @CMDBProperty(searchType = PropertyTypeString.ID)
    private String errorMsg;
}
